<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>allrencai</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript">
	function checkID() {
		var select_option = document.getElementById("select_option").value;
		var input_select_option = document
				.getElementById("input_select_option").value;
		if (select_option == 1) {
			if (input_select_option < 0) {
				alert("输入值非法，请重新输入");
				return false;
			} else if (input_select_option > 2147483647) {
				alert("输入值非法，请重新输入");
				return false;
			} else if (isNaN(input_select_option)) {
				alert("输入值非法，请重新输入");
				return false;
			} else {
				return true;
			}
		}

	}
</script>
</head>

<body>
	<a href="<%=basePath%>rencai/addrencai.jsp">添加</a>
	<div style="margin-left: 80px;width: 600px;height: 40px;">
		<label style="font-weight: bold; color:red;">查询说明:</label><br />
		<font style="font-weight: bold;">(1)</font> 在进行类型查询时只需输入类型所对应的<font
			style="font-weight: bold;">数字</font>即可:1 科技企业家 2 产学研人才 3 院士工作 4 技能人才
		5 三秦人才 <br /> <font style="font-weight: bold;">(2)</font>在进行编号查询时请您确认您输入的是<font
			style="font-weight: bold;">数字</font> 而不是其他字符
	</div>
	<div
		style="margin-left:auto;margin-right:auto ; width: 660px;height: 40px;margin-top: 50px;">
		<center>
			<form action="<%=basePath%>servlet/BackSearchServlet?type=rencai"
				method="post" onsubmit="return checkID()">
				<table>
					<tr>
						<td><label style="font-weight: bold;">关键字搜索</label> <select
							id="select_option" name="search" style="height: 30px;">
								<option value="1">按编号搜索</option>
								<option value="2">按标题搜索</option>
								<option value="3">按时间搜索</option>
								<option value="4">按内容搜索</option>
								<option value="5">按类型搜索</option>

						</select> <input id="input_select_option" type="text" name="title"
							style="width:250px;height: 30px;" placeholder="请输入关键字" /> <input
							type="submit" value="搜索" id="btn"
							style="height: 30px;background:#3358FF;" /></td>
					</tr>
				</table>
			</form>
		</center>
	</div>
	<div style="margin-top: 20px;">
		<c:if test="${fn:length(rencaisearchList.list)==0}">
			<center>
				<p>
					<font color=gray;
						style="font-family:'宋体'; font-size:25px; font-weight: bold;">没有搜索到你需要内容</font>
				</p>
			</center>
		</c:if>
	</div>
	<div style="margin-top: 20px;">
		<c:if test="${fn:length(rencaisearchList.list)!=0}">
			<center>
				<table style="border: 1px solid #BCE2F3;">
					<tr
						style="text-align:center; height: 28px;border-bottom: 1px solid #64B8E4;background: #E4F2FB;">
						<td>编号</td>
						<td>标题</td>
						<td>类型</td>
						<td>时间</td>
						<td>相关操作</td>
					</tr>
					<c:forEach items="${rencaisearchList.list}" var="r">
						<tr style="text-align:center;">
							<td>${r.id }</td>

							<td><a title="${r.title}" style="text-decoration: none;"
								href="<%=basePath%>servlet/RenCaiServlet?m=DetailRenCai&id=${r.id}">${r.title}</a>
							</td>

							<c:if test="${r.type==1}">

								<td>科技企业家</td>

							</c:if>
							<c:if test="${r.type==2}">
								<td>产学研人才</td>
							</c:if>
							<c:if test="${r.type==3}">
								<td>院士工作</td>
							</c:if>
							<c:if test="${r.type==4}">
								<td>技能人才</td>
							</c:if>
							<c:if test="${r.type==5}">
								<td>三秦人才</td>
							</c:if>
							<td>${r.time}</td>
							<td><a style="text-decoration: none;"
								href="<%=basePath%>servlet/RenCaiServlet?m=DelRenCai&id=${r.id}">删除</a>

								<a style="text-decoration: none;"
								href="<%=basePath%>servlet/RenCaiServlet?m=updateRenCaiDoc&id=${r.id}">添加文件</a>
							</td>
						</tr>
					</c:forEach>
				</table>
				<div style="margin-top: 20px;">
					<font color="#0000EE">共${rencaisearchList.maxPage}页</font>&nbsp;&nbsp;
					<a style="text-decoration: none;"
						href="<%=basePath%>servlet/BackSearchServlet?type=rencai&m=AllRenCai">第一页</a>
					<a style="text-decoration: none;"
						href="<%=basePath%>servlet/BackSearchServlet?type=rencai&m=AllRenCai&method=pre">上一页</a>
					<c:forEach begin="1" end="${rencaisearchList.maxPage}" step="1"
						var="i">
	&nbsp;&nbsp;<a style="text-decoration: none;"
							href="<%=basePath%>servlet/BackSearchServlet?type=rencai&m=AllRenCai&method=index&ind=${i}">${i }</a>
					</c:forEach>
					&nbsp;&nbsp; <a style="text-decoration: none;"
						href="<%=basePath%>servlet/BackSearchServlet?type=rencai&m=AllRenCai&method=next">下一页</a>
					<a style="text-decoration: none;"
						href="<%=basePath%>servlet/BackSearchServlet?type=rencai&m=AllRenCai&method=last">最后一页</a>
				</div>
			</center>
		</c:if>
	</div>
</body>
</html>
